package modellayer;

/**
 * The class Customer is to hold information about a given customer, of which a object is to be
 * saved in the CustomerContainer class.
 * 
 * @author Stefan Bols 
 * @version 140114
 */

public class Customer extends Person {
	private static int counter; // This counter keeps track of how many clerk objects
    // there has been initialized and creates an uniqe clerkNo for each clerk

	private int customerNo;
	

	public Customer(String firstName, String lastName, String addressStreet, String addressCity, String addressZipcode, String phone, String email) {
		super(firstName, lastName, addressStreet, addressCity, addressZipcode, phone, email);

		this.counter++;
		this.customerNo = this.counter;
	}

    /**
     * This is an accessor-method.
     * @return the field customerNo
     */
    public String getCustomerNo()
    {
    	String add = "";
    	if (customerNo < 10) {
    		add = "00000";
    	} else if (customerNo < 100) {
    		add = "0000";
    	} else if (customerNo < 1000) {
    		add = "000";
    	} else if (customerNo < 10000) {
    		add = "00";
    	} else if (customerNo < 100000) {
    		add = "0";
    	} else if (customerNo < 100000) {
    		add = "";
    	} else {
    		add = "err:";
    	}
        return add+customerNo;
    }
}
